/**
 * 
 */
package de.preamp.clients.java.playlist;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;

/**
 * @author André Stannek
 */
public class PlaylistManagerDummyImpl implements PlaylistManager
{
    /**
     * generated UID.
     */
    private static final long serialVersionUID = -2502803359673547526L;

    /**
     * 
     */
    private final transient List<Playlist> playlists;

    /**
     * 
     */
    public PlaylistManagerDummyImpl()
    {
	playlists = new ArrayList<Playlist>();
	playlists.add(new PlaylistInMemoryImpl("Dummy Playlist"));
    }

    @Override
    public final Collection<Playlist> getPlaylists()
    {
	return playlists;
    }

    @Override
    public final Playlist getSelectedPlaylist()
    {
	return playlists.get(0);
    }

    @Override
    public final Iterator<Playlist> iterator()
    {
	return playlists.iterator();
    }

    @Override
    public final void valueChanged(final ListSelectionEvent event)
    {
	event.getSource();
    }

    @Override
    public final void addListDataListener(final ListDataListener listener)
    {
	listener.hashCode();
    }

    @Override
    public final Object getElementAt(final int index)
    {
	return playlists.get(index);
    }

    @Override
    public final int getSize()
    {
	return playlists.size();
    }

    @Override
    public final void removeListDataListener(final ListDataListener listener)
    {
	listener.hashCode();
    }

    @Override
    public final void newPlaylist(final String name)
    {
	playlists.add(new PlaylistInMemoryImpl(name));
    }

    @Override
    public final void removePlaylist(final Playlist list)
    {
	playlists.remove(list);
    }

}
